//
//  TbInfoView.swift
//  SlaughterClient
//
//  Created by 邱仙凯 on 2020/2/6.
//  Copyright © 2020 zwb. All rights reserved.
//  通用内容动态行数展示框

import UIKit

class TbInfoView: UIView {
    
    @IBOutlet weak var titleLab: UITextField!
    @IBOutlet weak var wenhao: UIButton!
    @IBOutlet weak var rankTip: UILabel!
    @IBOutlet private weak var content1: CJLabel!
    var contentStr:String = "" {
        didSet {
            let paraph = NSMutableParagraphStyle()
            //将行间距设置为28
            paraph.lineSpacing = 5
            //样式属性集合
            let attributes = [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 14),
                              NSAttributedString.Key.paragraphStyle: paraph]
            self.content1.attributedText = NSAttributedString(string: contentStr, attributes: attributes)
            
        }
    }
    
    var attributedContentStr:NSAttributedString? {
        didSet {
            if let aContent = attributedContentStr {
                self.content1.attributedText = aContent
            }
           
            
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        content1.enableCopy = true
        content1.preferredMaxLayoutWidth = KSGlobal.screenW - 32
    }
    
    
}
